package com.sh15tech.mp.weixin.common;

import java.util.ArrayList;
import java.util.List;

import com.sh15tech.mp.weixin.modal.WxCar;

public class WxStore {

	private static List<WxCar> cars = new ArrayList<>();

	public static boolean contains(WxCar o){
		for(WxCar c : cars){
			if(c.getOpenId().equals(o.getOpenId())
					&& c.getCarNum().equals(o.getCarNum())
					&& c.getMobileNum().equals(o.getMobileNum())){
				return true;
			}
		}
		return false;
	}
	
	public static boolean save(WxCar o){
		
		try {
			cars.add(o);
			return true;
		} catch (Exception e) {
			return false;
		}
		
	}
		
}
